package chapter06;

//import java.util.Random;
import java.util.Scanner;

public class SubProgram {
    public static void main(String[] args) {
        int num1, num2;
        int res;

        num1 = (int)(Math.random()*10);
        num2 = (int)(Math.random()*10);

//        Random rand = new Random();
//        num1 = rand.nextInt()%10;
//        num2 = rand.nextInt()%10;

        if( num1 < num2){
            res = num1;
            num1 = num2;
            num2 = res;
        }

        res = num1 - num2;

        System.out.println("What is " + num1 + " - " + num2 + " ?");
        Scanner sc = new Scanner(System.in);
        int in = sc.nextInt();

        if(in == res){
            System.out.println("Yes");
        } else{
            System.out.println("No");
        }
    }

}
